The present invention relates to a graphics display controller which controls a display memory to display figures on a display screen of a raster scan cathode-ray tube, and more particularly to a boundary searching circuit provided in such a controller to determine a boundary of an area to be painted.
One of various functions performed by a graphics display controller is to paint or fill a closed area with a certain color or with an arbitrary pattern. To this end, it is required to search or determine a boundary of the area to be painted. Since each picture element on a display screen corresponds to each bit in a display memory, the boundary of the painting area is searched by detecting the data of the display memory. The boundary searching is executed in general in accordance with the following procedure:
(1) A searching start bit is given at random and the data of this searching start bit is detected. If data "1", for example, is stored in the searching start bit, this bit is regarded as being outside the area to be painted and the boundary searching is terminated. A new searching start bit is thus given.
(2) On the other hand, in case where the data stored at the searching start bit is data "0", detection is made to search whether or not a bit storing data "1" is present between the searching start bit and a left-end bit of a first word including the searching start bit. If the presence of such a bit is detected, a left-hand boundary of the area to be painted is determined.
(3) In case where the presence of such a bit is not detected, a second word adjacent leftward to the first word is read out and detection is made to search whether or not this second word includes a bit storing data "1". If the second word does not includes such a bit, a third word adjacent leftward to the second word is read out and the data of each bit of the third word is detected. The same processing operation is repeated until a bit storing data "1" is detected. Thus, the left-hand boundary of the area to be painted is searched.
(4) Next, the searching of a right-end boundary of the area is carried out, by detecting whether or not a bit storing data "1" is present between the searching start bit and a right-end bit of the first word. If the presence of such a bit is not detected, a fourth word adjacent rightward to the first word is read out and the data thereof is judged to detect whether or not the fourth word includes a bit stored with data "1". The same processing operation is executed until a bit stored with data "1" is detected. Thus, a right-hand boundary of the area to be painted is searched.
Since the above-mentioned first to fourth words are arranged in one horizontal line on the display screen, the left-hand boundary searching and the right-hand boundary searching are performed with respect to other words arranged in other horizontal lines on the display screen. Thus, the boundary of the area to be painted is searched.
According to prior art, the data of each word is detected one bit by one bit by use of a bit-shift instruction. For this reason, a very long processing time is required. For example, in case where 1000 bits are present between the left-hand boundary and the right-hand boundary, the bit-shift instruction and the data detecting operation are executed 1000 times.